<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="/common/jsp/taglibs-nojs-nocss.jsp"%>
<%@include file="/common/jsp/cssAndScript.jsp"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"+ request.getServerName() + ":" + request.getServerPort()+ path + "/";
%>


<div id="pop_up_content">
	<div class="pop_up_title images_1">
		密码修改
	</div>
	<div class="pop_up_body">
		<form id="pwdUpdate" name="pwdUpdate" action="<%=basePath %>login/pwdUpdate.action">
		<table border="0" cellpadding="0" cellspacing="0"  width="400">
			<tr>
				<td>
					<div class="form_input_value">
						原始密码
					</div>
				</td>
				<td>
					<input type="text" id="oldpassword" class="longinput required" name="user.password">
					<input  type="hidden" id="id" name="user.id" value="<s:property value='user.id'/>" >
				</td>
			</tr>
			<tr>
				<td>
					<div class="form_input_value">
						密码
					</div>
				</td>
				<td>
						<input type="text" id="password" class="longinput required" name="newPwd">
				</td>
			</tr>
			<tr>
				<td>
					<div class="form_input_value">
						确认密码
					</div>
				</td>
				<td>
					<input type="text" id="confirmpwd" class="longinput required" name="confirmpwd">
				</td>
			</tr>
			<tr>
				<td></td>
				<td>
					<input id="editSubmit" onclick="validatePwd()" type="button" value="确定" class="btn" onmouseout="this.className='btn'" onmousedown="this.className='btn1'" onmouseover="this.className='btn2'">
					<input type="button" value="取消" class="btn" onclick="hideDialog();" onmouseout="this.className='btn'" onmousedown="this.className='btn1'" onmouseover="this.className='btn2'">
				</td>
			</tr>
		</table>
		</form>
	</div>
</div>
<script type="text/javascript">
	function validatePwd(){
		var password = document.getElementById("password").value;
		var confirmpwd = document.getElementById("confirmpwd").value;
		if(confirmpwd != password){
			alert('两次密码输入不一致，请重新输入！');
		}else{
			/* 表单提交 */
			i.formSubmit("editSubmit",	//绑定的按钮id
				  "pwdUpdate" ,   //提交的表单id
				  function(result){
					  	var jsonMsgObj=new JsonMsgObj(result);
						var  msg=jsonMsgObj.getMessage();
					    var codeId=jsonMsgObj.getCodeid();
						var isOk=jsonMsgObj.getIsok();
						if( isOk ){
						    aerouiAlert(msg);
							hideDialog();// 隐藏窗口
						}else{		// 如果编辑失败了
						  JsManageInfoHandleException( result , function(msg , codeId , isOk){
						   });
					   }
					});
		}
	}
</script>
